package com.huabo.contract.mysql.entity;

import java.math.BigDecimal;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;

/**
 * <p>
 *
 * </p>
 *
 * @author huabo
 * @since 2022-03-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("TBL_CONTRACT_COLLECTION")
@ApiModel(value="TblContractCollection对象")
public class TblContractCollectionMySql implements Serializable {
//收款管理
    private static final long serialVersionUID = 1L;

    public final static Long STATE_SP = 1L;//审批中
    public final static Long STATE_TZ = 2L;//调整
    public final static Long STATE_TG = 3L;//已通过
    public final static Long STATE_ZZ = 4L;//已终止
    public final static Long STATE_GZ = 5L;//已跟踪
    public final static Long STATE_WC = 6L;//已完成

    @TableId("COLLECTIONID")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "select HIBERNATE_SEQUENCE.nextval from dual")
    private BigDecimal collectionid;

    @TableField("INVOICEID")
    private BigDecimal invoiceid;

    @TableField("COLLECTIONBANK")
    private String collectionbank;

    @TableField("COLLECTIONSKDATE")
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date collectionskdate;//收款日期

    @TableField("COLLECTIONACCOUNT")
    private String collectionaccount;

    @TableField("COLLECTIONORGNAME")//付款单位
    private String collectionorgname;

    @TableField("CONTRACTID")
    private BigDecimal contractid;

    @TableField("NODEID")
    private BigDecimal nodeid;

    @TableField("CREATESTAFF")
    private BigDecimal createstaff;

    @TableField("COLLECTIONSTATUS")//审批状态：1-审批中，2-需调整，3-已通过，4-已终止，5-已跟踪，6-已完成，7-未审批
    private Long collectionstatus;

    @TableField("LINKORG")
    private BigDecimal linkorg;

    @TableField("CREATEDATE")
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date createdate;

    @TableField("NODEMONEY")//对应收款金额
    private BigDecimal nodemoney;

    @TableField("COUNTERBANK")//财务管理-收款管理-新增-付款银行账号
    private BigDecimal counterbank;

    @TableField("ORGBANK")//财务管理-收款管理-新增-收款银行账号
    private BigDecimal orgbank;

    @Transient
    private BigDecimal bankbankid;
    @Transient
    private BigDecimal bankid;
    @Transient
    private TblStaffMySql createStaff;

    @Transient
    private TblCyhwUnitMySql contract;

    @Transient
    private TblOrganizationMySql linkOrg;

    @Transient
    private TblContractPlannodeMySql node;

    @Transient
    private TblContractInvoicesmanagemenMySql invoice;


//    public void setLinkOrg(BigDecimal orderid) {
//
//    }

    //映射TblContractInvoicesmanagemen与TblCyhwUnit


    @Transient
    private BigDecimal budgetid;

    @Transient//发票号
    private String invoiceno;

    @Transient//开票金额
    private BigDecimal invoicemoney;

    @Transient
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date invoicedate;//开票日期

    @Transient//发票抬头
    private String invoiceheadtext;

    @Transient
    private BigDecimal invoicepost;

    @Transient//发票内容
    private String invoicecontent;

    @Transient//发票类型
    private String invoicetype;

    @Transient//发票状态
    private BigDecimal invoicestatus;

    @Transient
    @JSONField(format = "yyyy-MM-dd")
    private Date invoicespdate;

    @Transient
    private String invoicesporg;

    @Transient//开票单位
    private String invoicekporg;

    @Transient
    private BigDecimal invoiceogr;


    @Transient
    private String tinumber;

    @Transient
    private String outsideid;



    @ApiModelProperty(value = "隶属流程id 关联Tbl_flow flowid")
    @Transient
    private BigDecimal flowid;

    @ApiModelProperty(value = "单位名称")
    @Transient
    private String unitname;

    @ApiModelProperty(value = "合同名称")
    @Transient
    private String contractname;

    @ApiModelProperty(value = "合同编号")
    @Transient
    private String contractno;

    @ApiModelProperty(value = "承办部门")
    @Transient
    private BigDecimal contractdept;

    @ApiModelProperty(value = "合同对方")
    @Transient
    private String contractlink;

    @ApiModelProperty(value = "合同金额")
    @Transient
    private BigDecimal contractmoney;

    @ApiModelProperty(value = "合同状态 1-审批中、2-需调整、3-已通过、4-已终止、5-已跟踪、6-已完成、7-执行中、		8-已归档、		9-已暂停、		10-已变更、		11-已终止、		12-纠纷中、		13-协商中、		14-诉讼中、		15-仲裁中、		16-已结案")
    @Transient
    private Integer contractstatus;

    @ApiModelProperty(value = "关联科室")
    @Transient
    private String linkdept;

    @ApiModelProperty(value = "隶属组织")
    @Transient
    private BigDecimal orgid;

    @ApiModelProperty(value = "创建人")
    @Transient
    private BigDecimal createuser;

    @ApiModelProperty(value = "创建时间")
    @Transient
    @JSONField(format = "yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createtime;

    @ApiModelProperty(value = "合同简要说明")
    @Transient
    private String momoconcat;

    @ApiModelProperty(value = "关联的风险控制")
    @Transient
    private String riskcontrol;

    @ApiModelProperty(value = "合同内容")
    @Transient
    private String describe;

    @ApiModelProperty(value = "承办人")
    @Transient
    private BigDecimal contractstaff;

    @ApiModelProperty(value = "保密等级")
    @Transient
    private String scrilevel;

    @ApiModelProperty(value = "合同开始时间")
    @Transient
    @JSONField(format = "yyyy-MM-dd")
    private Date startdate;

    @ApiModelProperty(value = "合同结束时间")
    @Transient
    @JSONField(format = "yyyy-MM-dd")
    private Date enddate;

    @ApiModelProperty(value = "合同项目")
    @Transient
    private String contractitem;

    @ApiModelProperty(value = "合同类型")
    @Transient
    private String contracttype;

    @ApiModelProperty(value = "合同期限类型")
    @Transient
    private String contractdatetype;

    @ApiModelProperty(value = "合同性质")
    @Transient
    private String contractxz;

    @ApiModelProperty(value = "合同相对方主键ID")
    @Transient
    private BigDecimal contractxdfxinfo;

    @ApiModelProperty(value = "合同类型 HTGL001 - 相对方、HTGL002-合同订立、HTGL003-合同用印、HTGL004-合同履行、HTGL005-变更、HTGL006-合同归档、HTGL007-合同范本")
    @Transient
    private String recordtype;

    @ApiModelProperty(value = "隶属合同 cyhwunitId")
    @Transient
    private BigDecimal recordparent;

    @ApiModelProperty(value = "合同金额汉字描述")
    @Transient
    private String hzsumowing;

    @ApiModelProperty(value = "计价方式")
    @Transient
    private String jijiatype;

    @ApiModelProperty(value = "币种")
    @Transient
    private String moneytype;

    @ApiModelProperty(value = "首付方向")
    @Transient
    private String dctype;

    @ApiModelProperty(value = "合同标的")
    @Transient
    private String contractbd;

    @ApiModelProperty(value = "是否重大合同")
    @Transient
    private String contractzd;

    @ApiModelProperty(value = "经办人")
    @Transient
    private BigDecimal jbstaff;

    @ApiModelProperty(value = "经办部门")
    @Transient
    private BigDecimal jbdept;

    @ApiModelProperty(value = "经办公司")
    @Transient
    private BigDecimal jbunit;

    @ApiModelProperty(value = "执行公司")
    @Transient
    private BigDecimal zxunit;

    @ApiModelProperty(value = "是否关联主合同")
    @Transient
    private String contractchildren;

    @ApiModelProperty(value = "是否有履行计划")
    @Transient
    private String contractplan;

    @ApiModelProperty(value = "合同立项信息")
    @Transient
    private String topicid;

    @ApiModelProperty(value = "合同立项名称")
    @Transient
    private String topicname;

    @ApiModelProperty(value = "历史状态")
    @Transient
    private BigDecimal hiscontractstatus;

    @ApiModelProperty(value = "变更类型")
    @Transient
    private String changetype;

    @ApiModelProperty(value = "变更时间")
    @Transient
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime changedate;

    @ApiModelProperty(value = "变更内容")
    @Transient
    private String changedesc;

    @Transient
    private BigDecimal counterpartbank;

    @Transient
    @ApiModelProperty(value = "相对方名称")//付款单位
    private String budgetname;

    @Transient//对应收款项TblContractPlannode
    private String nodecontent;

    @Transient//付款账户
    private String counterBankAccount;

    @Transient//收款账户
    private String orgBankName;

    @Transient//TblCounterpartBankinfo收款银行账号
    private String bankaccname;//收款银行名称

    @Transient
    private String bankaccount;//收款银行账号

    @Transient//TblOrgBankaccount付款银行账号
    private String bankaccnum;

    //TblFlow
    @ApiModelProperty(value = "流程编号")
    @Transient
    private String flownumber;
    @ApiModelProperty(value = "流程名称")
    @Transient
    private String flowname;
    @ApiModelProperty(value = "公司ID")
    @Transient
    private String company;
    @ApiModelProperty(value = "部门ID")
    @Transient
    private String departincharge;
    @ApiModelProperty(value = "使用范围")
    @Transient
    private String flowrange;
    @ApiModelProperty(value = "流程状态")
    @Transient
    private String flowstatus;
    @ApiModelProperty(value = "备注")
    @Transient
    private String memo;
    @ApiModelProperty(value = "版本")
    @Transient
    private BigDecimal version;
    @Transient
    private String flowchart;
    @ApiModelProperty(value = "业务参与部门")
    @Transient
    private String departassist;
    @ApiModelProperty(value = "录入人")
    @Transient
    private String editor;
    @ApiModelProperty(value = "更新时间")
    @Transient
    @JSONField(format = "yyyy-MM-dd")
    private LocalDateTime updatetime;
    @Transient
    private String relatedrules;
    @Transient
    private String affectdegree;
    @Transient
    private String interfaced;
    @ApiModelProperty(value = "父流程ID")
    @Transient
    private BigDecimal fatherflowid;
    @ApiModelProperty(value = "最后更改时间")
    @Transient
    private String lastmodifiedtime;
    @Transient
    private Integer flowbysystem;
    @Transient
    private BigDecimal inflowdb;
    @Transient
    private BigDecimal position;
    @Transient
    private BigDecimal versiontype;
    @Transient
    @ApiModelProperty(value = "审批状态")
    private BigDecimal status;
    @Transient
    @ApiModelProperty(value = "系统流程Id")
    private String settingid;
    @Transient
    @ApiModelProperty(value = "表单ID")
    private BigDecimal fromid;
    @Transient
    @ApiModelProperty(value = "是否启用  1 启动 2弃用 null 未启动")
    private BigDecimal firingstatus;
    @Transient
    @ApiModelProperty(value = "流程图Id")
    private String editmodule;
    @Transient
    @ApiModelProperty(value = "后台访问地址")
    private String flowmappingurl;

    //TblContractPlannode
    @Transient
    private BigDecimal projectid;
    @Transient
    private BigDecimal blprojectid;
    @Transient
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date planstartdate;
    @Transient
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date planenddate;//预计结束时间
    @Transient
    private String nodepost;
    @Transient
    @JSONField(format = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date nodeplanpaydate;//预计开始时间
    @Transient
    private BigDecimal dispatchstaff;
    @Transient//履行情况
    private BigDecimal dispatchdept;
    @Transient
    private BigDecimal plannodestatus;
    @Transient
    @ApiModelProperty(value = "反馈意见")
    private String feedback;


    @ApiModelProperty(value = "taskId")
    @Transient
    private String taskid;
}
